<?php

declare(strict_types=1);

namespace Modules\CustomReport\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $report_name
 * @property $table_name
 * @property $route_path
 * @property $fields_json
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class CustomReport extends Model
{
    

    protected $table = 'custom_report';

    protected $fillable = [ 'id', 'report_name', 'table_name', 'route_path', 'fields_json', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['id','report_name','table_name','route_path','fields_json','created_at','updated_at'];

    /**
     * @var array
     */
    protected array $form = ['report_name','table_name','route_path','fields_json','created_at','updated_at'];

    /**
     * @var array
     */
    public array $searchable = [
        'report_name' => 'like',
'table_name' => 'like',

    ];

    /**
     * 时间格式化
     * @param $date
     * @return mixed
     */
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }

    
}
